<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
            list-style: none;
        }

        .container {
            /* 变为弹性盒子的容器 */
            display: inline-flex;
            width: 300px;
            background-color: #f00;
            margin: auto;
        }

        .item {
            width: 50px;
            height: 50px;
            background-color: #0f0;
            box-sizing: border-box;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <ul class="container">
        <li class="item">项目1</li>
        <li class="item">项目2</li>
        <li class="item">项目3</li>
    </ul>
    <span>我是一个span标签，上面的盒子display: inline-flex;是行内块级的弹性盒子。</span>
</body>
</html>